import argparse
from src.proxy.jenkins_proxy import JenkinsProxy

args = argparse.ArgumentParser()
# args.add_argument("-u", type=str, dest="jenkins_user", help="jenkins user name")
# args.add_argument("-t", type=str, dest="jenkins_api_token", help="jenkins api token")
# args.add_argument("-m", type=str, dest="template_job", help="template job name")
# args.add_argument("-s", type=str, dest="template_job_base_url", help="jenkins base url of template job")
# args.add_argument("-j", type=str, dest="target_jobs", nargs="+", help="jobs to created")
# args.add_argument("-d", type=str, dest="target_job_base_url", help="jenkins base url of target jobs")
# args.add_argument("-l", type=str, dest="exclude_jobs", nargs="*", help="jobs not to created")
# args.add_argument("-o", type=int, dest="jenkins_timeout", default=10, help="jenkins api timeout")
template_job_base_url = "http://jenkins.jenkins/job/multiarch/job/openeuler/job/trigger"
jenkins_user = ""
jenkins_api_token = ""
jenkins_timeout = ""
template_job = ""
p_m = JenkinsProxy(template_job_base_url, jenkins_user, jenkins_api_token, jenkins_timeout)
res = p_m.get_config(template_job)
print(res)
res1 = p_m.create_job('abc', res)
print(res1)
# print("============= args.target_job_base_url: %s============"%(args.target_job_base_url))
# jp_t = JenkinsProxy(args.target_job_base_url, args.jenkins_user, args.jenkins_api_token, args.jenkins_timeout)